package stu.info.student.info.mapper;

import org.apache.ibatis.annotations.*;
import stu.info.student.info.entity.Admin;

import java.util.List;

@Mapper
public interface adminMapper {
    /*添加管理员*/
    @Insert("insert into admin values(null,#{aname},#{sex},#{phone})")
    void insert(Admin admin);

    /*删除管理员根据id*/
    @Delete("delete from admin where ano=#{ano}")
    void deleteById(Long ano);

    /*获得管理员数据*/
    @Select("select ano,aname,sex,phone from admin")
    List<Admin> select();

    /*根据id更新管理员数据*/
    @Update("update admin set aname=#{aname},sex=#{sex},phone=#{phone} where ano=#{ano}")
    void updateById(Admin admin);
}
